import request from '@/util/request'
import { dealOpts, UTILS, GENERAL } from './../api_type'

// UTILS
const utilsGetAttributes = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getAttributes', opts), params)
}

const utilsCreateAttr = (params, opts) => {
  return request.get(dealOpts(UTILS + '/createAttribute', opts), params)
}

const utilsGetAttrById = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getAttributeInfo', opts), params)
}

const utilsUpdateAttr = (params, opts) => {
  return request.get(dealOpts(UTILS + '/modifyAttribute', opts), params)
}

const utilsDeleteAttr = (params, opts) => {
  return request.get(dealOpts(UTILS + '/deleteAttribute', opts), params)
}

const utilsGetAttributeInfo = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getAttributeInfo', opts), params)
}

const utilsGetClass = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getClasses', opts), params)
}

const utilsCreateClass = (params, opts) => {
  return request.get(dealOpts(UTILS + '/addClass', opts), params)
}

const utilsGetClassById = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getClassInfo', opts), params)
}

const utilsUpdateClass = (params, opts) => {
  return request.get(dealOpts(UTILS + '/modifyClass', opts), params)
}

const utilsDeleteClass = (params, opts) => {
  return request.get(dealOpts(UTILS + '/deleteClass', opts), params)
}

const utilsGetAllClasses = (params, opts) => {
  return request.get(dealOpts(UTILS + '/getAllClasses', opts), params)
}

const utilsGetAddress = (params, opts) => {
  return request.get(dealOpts(GENERAL + '/getAreas', opts), params)
}

export default {
  utilsGetAttributes,
  utilsCreateAttr,
  utilsGetAttrById,
  utilsUpdateAttr,
  utilsDeleteAttr,
  utilsGetClass,
  utilsCreateClass,
  utilsGetClassById,
  utilsUpdateClass,
  utilsDeleteClass,
  utilsGetAllClasses,
  utilsGetAddress,
  utilsGetAttributeInfo
}
